<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html> 
  <head> 
    <title>Clinique de Santa Fe</title> 
    <%= stylesheet_link_tag "depot", :media => "all" %>
    <%= javascript_include_tag :defaults %>
    <%= yield :header %>
  </head> 
  <body id="store"> 
    <% form_tag '', :method => 'GET', :class => 'locale' do %> 
      <%= select_tag 'locale', options_for_select(LANGUAGES, I18n.locale), 
        :onchange => 'this.form.submit()' %> 
      <%= submit_tag 'submit' %> 
      <%= javascript_tag "$$('.locale input').each(Element.hide)" %> 
    <% end %>
    <div id="banner"> 
      <%= link_to image_tag("logo.jpg"), :controller => :public %>
      <p><%= @page_title || I18n.t("layout.title") %> </p>
    </div>
    <div id="columns"> 
      <div id="side">
        <% @user = User.find(session[:user_id]) if session[:user_id]%>
        <p id="loggedUser"><%= "Bonjour&nbsp;" unless @user.nil? %><p id="userName"><%= " #{@user.firstname} #{@user.lastname}" unless @user.nil? %></p></p>
        <div class="cleardiv"></div>
		<div id="cartContainer">
          <% hidden_div_if(@cart.items.empty?, :id => "cart") do %>
            <%= render :partial => "cart", :object => @cart %>
          <% end if @cart %>
        </div>
        <%= link_to I18n.t("layout.sidebar.home"), :controller => :public %><br />
        <%= link_to I18n.t("layout.sidebar.news"), :controller => :actualities %><br />
        <%= link_to "Articles", :controller => :articles %>
        <%= link_to I18n.t("layout.sidebar.contact"), :controller => :public, :action => :contact %><br />
      
      <% if @user %>
        <%= link_to('interface admin', :controller => 'admin/dashboard') if Rule.can_view_admin?(@user) %>
        <br />
        <%= link_to "Calendrier", :controller => 'tasks' %><br />
        <%= link_to I18n.t("layout.sidebar.product"), :controller => 'store' %><br />
        <%= link_to I18n.t('layout.sidebar.user'), :controller => 'users' %><br />
        <br />
        <%= link_to I18n.t('layout.sidebar.user_page'), :controller => :users, :action => :show, :id => session[:user_id] %><br />
        <%= link_to I18n.t('layout.sidebar.logout'), :controller => :sessions, :action => :logout %><br />
      <% else %>
        <%= link_to I18n.t('layout.sidebar.login'), :controller => :sessions, :action => :login %><br />
        <%= link_to I18n.t('layout.sidebar.register'), :controller => :users, :action => :new if Rule.registration_enable? %>
      <% end %>
      </div>
      
      <div id="main">
        <% if flash[:notice] -%> 
          <div id="notice"><%= flash[:notice] %></div> 
        <% end -%>

        <%= yield :layout %> 
      </div> 
    </div> 
  </body> 
</html> 
